/*
 * Copyright the original author or authors.
 * 
 * Licensed under the MOZILLA PUBLIC LICENSE, Version 1.1 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *      http://www.mozilla.org/MPL/MPL-1.1.html
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
 
/**
 * @author Simon Oliver
 * @version 1.0
 */

// Classes from Wilberforce

import wilberforce.geom.rect;
import wilberforce.util.drawing.styles.*;
import wilberforce.ui.canvas.*;
import wilberforce.ui.simpleUIFactory;
import wilberforce.ui.forms.abstractScrollbar;
import wilberforce.dataProviders.XMLtoObject;

// Classes from Pixlib
import com.bourre.log.Logger;
import com.bourre.log.LogLevel;
import com.bourre.utils.LuminicTracer;
import com.bourre.events.IEvent;
import com.bourre.events.BasicEvent;
import com.bourre.events.EventType;

// Project Classes
import wilberforce_demos.canvas.canvasDemo1ImageItem;

/**
* Demo to illustrate the use of gridLayoutFixed. Sets up a simple scene and allows you to 
* manipulate it with various elements such as the scrollbar and the transformableRect.
* 
*/
class wilberforce_demos.canvas.canvasDemo1 extends MovieClip 
{
	
	var _canvas:AbstractCanvas;
	private var _canvasContainer:MovieClip;
	
	function canvasDemo1(container)
	{
		container.__proto__ = this.__proto__;
		container.__constructor__ = canvasDemo1;
		this = container;	
		_init();
	}
	
	private function _init(Void):Void
	{
		Logger.getInstance().addLogListener( LuminicTracer.getInstance() );
		Logger.LOG("canvasDemo1 Initialised",LogLevel.INFO);
		
		_canvasContainer=this.createEmptyMovieClip("canvas",this.getNextHighestDepth());
		_canvas=new AbstractCanvas(_canvasContainer,rect.fromStage().getMarginRect(10,10));
		
		var tItem=new canvasDemo1ImageItem("http://images.google.co.uk/images?q=tbn:ztiwso9EsJFCvM:http://www.pointernet.pds.hu/Kutya/wallpapers/dog_002N.jpg");
		_canvas.addItem(tItem,100,100);
		
		var tItem2=new canvasDemo1ImageItem("http://images.google.co.uk/images?q=tbn:EKoQaGkVqVfDgM:http://upload.wikimedia.org/wikipedia/en/thumb/a/aa/Male_goat.jpg/250px-Male_goat.jpg");
		_canvas.addItem(tItem2,300,100);
	}

}